//
//  twoWeiXinDingDan.m
//  EJLX
//
//  Created by xufei on 15/12/3.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "twoWeiXinDingDan.h"
#import "thireWeiXinDingDan.h"
@implementation twoWeiXinDingDan
+(id)userWithDictionary:(NSDictionary*)userDic
{
    return [[self alloc]initWithDictionary:userDic];
}
-(id)initWithDictionary:(NSDictionary*)userDic
{
    self=[super init];
    if (self)
    {
        
        _orderId=[userDic[@"orderId"]intValue];
        _money=[userDic[@"money"]intValue];
        _buyerId=[userDic[@"buyerId"]intValue];
        _venderId=[userDic[@"venderId"]intValue];
        _deliveryFee=[userDic[@"deliveryFee"]intValue];
       _itemNum=[userDic[@"itemNum"]intValue];
        _earningNum=[userDic[@"earningNum"]intValue];
        _status=[userDic[@"status"]intValue];
        _type=[userDic[@"type"]intValue];
        _tradeDate=[userDic[@"tradeDate"]copy];
        _channel=[userDic[@"channel"]copy];
        _buyerName=[userDic[@"buyerName"]copy];
        _buyerPhone=[userDic[@"buyerPhone"]copy];
        _venderName=[userDic[@"venderName"]copy];
       _venderPhone=[userDic[@"venderPhone"]copy];
        NSMutableArray*itemlistAry=userDic[@"itemlist"];
        NSLog(@"-------+%lu",(unsigned long)itemlistAry.count);
        _itemlistAry=[NSMutableArray array];
        if (itemlistAry.count!=0)
        {
            for (int i=0; i<itemlistAry.count; i++)
            {
                thireWeiXinDingDan*weid=[thireWeiXinDingDan userWithDictionary:itemlistAry[i]];
                [_itemlistAry addObject:weid];
                NSLog(@"itemary----%lu",(unsigned long)_itemlistAry.count);
            }

        }
        
    }
    return self;
}

@end
